﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Collections;
using DTO;

namespace DAO
{
    public class WebServiceDAO
    {
        public WebServiceDTO layThongTinWebServiceTheoMaNCC(string maNCC)
        {
            List<string> paraLst = new List<string>();
            ArrayList valueArr = new ArrayList();
            paraLst.Add("@mancc");
            valueArr.Add(maNCC);
            try
            {
                DataTable dt = DataProvider.ExecuteStoreProc("sp_WebService_layThongTinWebServiceTheoMaCC", paraLst, valueArr);
                if(dt.Rows.Count == 0)
                    return null;
                WebServiceDTO ws = new WebServiceDTO();
                ws.DiaChiWS = dt.Rows[0]["DiaChiWS"].ToString();
                ws.MaNCC = dt.Rows[0]["MaNCC"].ToString();
                ws.MaWS = dt.Rows[0]["MaWS"].ToString();
                ws.Password = dt.Rows[0]["Password"].ToString();
                ws.TrangThai = dt.Rows[0]["TrangThai"].ToString();
                ws.Username = dt.Rows[0]["Username"].ToString();
                return ws;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
